<?php

namespace backend\modules\pooai\models;

use Yii;
use yii\behaviors\TimestampBehavior;

/**
 * This is the model class for table "zpooai_pages".
 *
 * @property string $pooai_pages_id
 * @property string $pooai_pages_name
 * @property string $pooai_link
 * @property string $created_at
 * @property string $updated_at
 */
class ZpooaiPages extends \yii\db\ActiveRecord
{
    public $images;
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
            // 名为myBehavior4的行为，也是给出了MyBehavior类的配置数组
            'uuid' => [
                'class' => \common\behavior\uuidBehavior::className(),
                'owner' => $this
            ]
        ];
    }

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'zpooai_pages';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            ['pooai_pages_id','default','value'=>$this->getUUID()],
            [['created_at', 'updated_at'], 'integer'],
            [['pooai_pages_id'], 'required'],
            [['pooai_pages_name'], 'string', 'max' => 60],
            [['pooai_link'], 'string', 'max' => 255],
            [['pooai_pages_name'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'pooai_pages_id' => Yii::t('app', '页面ID'),
            'pooai_pages_name' => Yii::t('app', '页面标题'),
            'pooai_link' => Yii::t('app', '页面链接'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }

    /**
     * @inheritdoc
     * @return \backend\modules\pooai\models\query\ZpooaiPagesQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \backend\modules\pooai\models\query\ZpooaiPagesQuery(get_called_class());
    }
}
